Skip to content

Update rand to 0.9#76

Merged
sebcrozet merged 2 commits into
dimforge:masterfrom
im-0:update-rand
May 24, 2026
Merged

Update rand to 0.9#76
sebcrozet merged 2 commits into
dimforge:masterfrom
im-0:update-rand

Conversation

@im-0
Copy link
Copy Markdown
Contributor

@im-0 im-0 commented Sep 8, 2025

Implementations of Distribution<T> for StandardUniform for all SIMD types containing isize and usize now generate random values using fill_bytes().

Uniform distribution for isize and usize was removed from rand crate. See rust-random/rand#1487 for details.

There is a new UniformUsize distribution, but it is limited to a maximum value under u32::MAX for portability across 32/64bits and for use as array indexes and lengths. Probably it is not suitable if a real uniform distribution is required.

Note that this is a breaking change. nalgebra already updated rand to 0.9 in dimforge/nalgebra@2da148c.

@im-0
Copy link
Copy Markdown
Contributor Author

im-0 commented Sep 20, 2025

I renamed new macro to not shadow the old one.

Also disabled new functions unless feature = "portable_simd" is enabled. (was a mistake, reverted)

im-0 and others added 2 commits May 24, 2026 16:09
Implementations of `Distribution<T> for StandardUniform` for all
SIMD types containing `isize` and `usize` now generate random
values using `fill_bytes()`.

Uniform distribution for `isize` and `usize` was removed from `rand` crate.
See rust-random/rand#1487 for details.

There is a new `UniformUsize` distribution, but it is limited to a
maximum value under u32::MAX for portability across 32/64bits and for
use as array indexes and lengths. Probably it is not suitable if a real
uniform distribution is required.
@sebcrozet sebcrozet merged commit 1f89154 into dimforge:master May 24, 2026
5 checks passed
@sebcrozet
Copy link
Copy Markdown
Member

Thanks!

@sebcrozet sebcrozet mentioned this pull request May 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants